A semiconductor device such as an insulated gate bipolar transistor (IGBT) module is used, for example, for electric power control on a motor. Patent Literature 1 discloses a semiconductor device having a semiconductor element such as an IGBT. This semiconductor device has a main electrode connected to a metal pattern electrically connected to the semiconductor element.